﻿<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
<script type="text/javascript" src="../lib/html5.js"></script>
<script type="text/javascript" src="../lib/respond.min.js"></script>
<script type="text/javascript" src="../lib/PIE_IE678.js"></script>
<![endif]-->
    <link href="../css/H-ui.min.css" rel="stylesheet" type="text/css" />
    <link href="../css/H-ui.admin.css" rel="stylesheet" type="text/css" />
    <link href="../lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
    <!--[if IE 6]>
<script type="text/javascript" src="../lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
    <title>图库管理</title>
    </head>
<body>
    <div class="pd-5">
        <div class="text-c" id="findfdiv">
            上传时间范围：
            <input type="text" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'findaddtimes_timee\')||\'%y-%M-%d\'}'})" id="findaddtimes_times" name="findaddtimes_times" class="input-text Wdate" style="width: 120px;">
            -
            <input type="text" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'findaddtimes_times\')}',maxDate:'%y-%M-%d'})" id="findaddtimes_timee" name="findaddtimes_timee" class="input-text Wdate" style="width: 120px;">
            <input type="text" class="input-text" style="width: 250px" placeholder="输入名称" id="findfimgname" name="findfimgname"><br/>
            <input type="text" class="input-text" style="width: 250px" placeholder="主类别" id="findflb1" name="findflb1">
              <input type="text" class="input-text" style="width: 250px" placeholder="子类别" id="findflb2" name="findflb2">
            <button onclick="findreolad()" class="btn btn-success radius" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜图片</button>
        </div>
        <div class="cl pd-5 bg-1 bk-gray mt-5">
            <span class="l">
                <a href="javascript:;" onclick="toolDelete()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 删除</a>
              <!--  <a href="javascript:;" onclick="toolUpdate()" class="btn btn-secondary radius"><i class="Hui-iconfont">&#xe6df;</i> 修改</a>
                <a href="javascript:;" onclick="toolAdd()" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 添加</a>-->
                 <a href="javascript:;" onclick="toolAddMore()" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 批量上传</a>

            </span>
            <span class="r"><a target="_blank" href="../imgshow/hcrain.html" style="color: #0000FF; font-weight: bold">前台查看:图库大全</a> </span>

        </div>
        <div class="mt-5 ml-20">
            <table class="table table-border table-bordered table-striped table-hover" id="tablelist" width="100%">
                <thead>
                    <tr class="text-c">
                        <th width="30"><a id="hcmtable_sall" onclick="hcmtable_sall();" href="javascript:;" title="全选反选"><i class="Hui-iconfont">&#xe608;全</i></a></th>
                        <th>名称</th>
                        <th>图片</th>
                        <th>主类别</th>
                        <th>子类别</th>
                        <th>子子类别</th>
                        <th>备注</th>
                        <th>时间</th>
                        <th>操作</th>

                    </tr>
                </thead>
                <tbody>
                </tbody>
            </table>

        </div>
    </div>
    <script src="../hcjsui/Scripts/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="../lib/layer/1.9.3/layer.js"></script>
    <script type="text/javascript" src="../lib/laypage/1.2/laypage.js"></script>
    <script type="text/javascript" src="../lib/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="../lib/datatables/1.10.0/jtable.js"></script>
    <script src="../hcjsui/js/_Define.js" type="text/javascript"></script>
    <script type="text/javascript" src="../js/hcui.js"></script>
    <script type="text/javascript" src="../js/hcui_list.js"></script>
    <script type="text/javascript">
        $(function () {
            layer.config({
                extend: 'extend/layer.ext.js'
            });
            spsetBaseNoBt("sysfileinfo", "id", "sysfileinfo as T", "*", "#tablelist", "sysfileinfo", "图库图片", "imgshow");
            hcmtable = $("#tablelist").DataTable({
                "serverSide": true,//服务端处理分页 无法使用当前查找
                "bFilter": false,  //是否使用内置的过滤功能
                "bInfo": true, "fnDrawCallback": function () { dTappendSkipPage(); },
                "ajax": {
                    "type": "POST",
                    "url": spselUrl(" and savetype='files'"),
                    "data": function (d) {
                        if (hcmtable != null && hcmtable != 'undefined') {
                            var info = hcmtable.page.info();
                            var dataRows = info.recordsTotal;//回传总行数
                            d["hcrainallrow"] = dataRows;
                        }
                        else {
                            d["hcrainallrow"] = 0;
                        }
                        $("#findfdiv").find("input[type='text']").each(function () {
                            d[this.id] = $(this).val();
                        });
                    }
                },
                "order": [[7, "desc"]],//默认第几个排序
                aLengthMenu: [5, 10, 20, 50],
                "columns": [
                                     { "data": "id" }
, { "data": "fimgname" }
, { "data": "fsaveurlmin" }
, { "data": "flb1" }
, { "data": "flb2" }
, { "data": "flb3" }
, { "data": "fdesc" }
, { "data": "addtimes" },
{ "data": "id" }
                ],



                "columnDefs": [

                   // 特殊显示列
                    {
                        "targets": [2],
                        "render": function (data, type, row) {
                          
                            return "<img title=\"\" src=\"" + data + "\"> ";
                           
                        }
                    }
                    ,
                   // 操作列
                    {
                        "targets": [8],
                        "render": function (data, type, row) {
                            return "<a style=\"text-decoration:none\" class=\"ml-5\" onClick=\"showimg('" + row.fsaveurl + "','" + row.fsaveurlmin + "')\" href=\"javascript:;\" title=\"查看原图\"><i class=\"Hui-iconfont\">&#xe6df;查看原图</i></a> " +
                            "<a style=\"text-decoration:none\" class=\"ml-5\" onClick=\"toolDelete('" + data + "')\"     href=\"javascript:;\" title=\"删除\"><i class=\"Hui-iconfont\">&#xe6e2;删除</i></a>";
                            //"<a style=\"text-decoration:none\" onClick=\"toolUpdateById(" + data + ")\" href=\"javascript:;\" title=\"审核\">审核</a>" +
                        }
                    },

                    //不排序
                   {
                       "orderable": false,
                       "targets": [0, 1, 2, 3, 4, 5, 6, 8]
                   }
         

                ]
            });



        });


        function toolAddMore() {
            var index = layer.open({
                type: 2,
                title: "批量上传信息",
                content: "imgshow-postimg.html?action=add",
                end: function () {
                    findreolad("sdivclosed");
                }
            });
            layer.full(index);

        }
        function showimg(src, thumb) {
            hcmtable_sno();

            layer.open({
                type: 1,
                title: false,
                closeBtn: false,
                area: '800px',
                skin: 'layui-layer-nobg', //没有背景色
                shadeClose: true,
                content: "<img title=\"\" src=\"" + src + "\">"
            });



        //    var json = {
        //    "title": "", //相册标题
        //    "id": 123, //相册id
        //    "start": 0, //初始显示的图片序号，默认0
        //    "data": [   //相册包含的图片，数组格式
        //        {
        //            "alt": "",
        //            "pid": 666, //图片id
        //            "src": src, //原图地址
        //            "thumb": thumb //缩略图地址
        //        }
        //    ]
        //};
        //    layer.photos({
        //        photos: json
        //    });


            //layer.open({
            //    type: 1,
            //    title: false,
            //    closeBtn: false,
            //    area: '516px',
            //    skin: 'layui-layer-nobg', //没有背景色
            //    shadeClose: true,
            //    content: img
            //});

        }
    </script>
</body>
</html>
